package org.moonlight.jvm.instructions.math.bool.xor;

import org.moonlight.jvm.instructions.base.NoOperandsInstruction;
import org.moonlight.jvm.rtda.exclusive.Frame;
import org.moonlight.jvm.rtda.exclusive.OperandStack;

/**
 * IXOR: 弹出 操作数栈栈顶 的两个 int型变量，进行 异或运算(^ - 相同得零 相异得一), 然后将结果压入操作数栈
 *
 * @author Moonlight
 * @createTime 2023/8/18 11:51
 **/
public class IXor extends NoOperandsInstruction {
    @Override
    public void execute(Frame frame) {
        OperandStack stack = frame.getOperandStack();

        int a = stack.popInt();
        int b = stack.popInt();

        stack.pushInt(a ^ b);
    }
}
